//
//  DetailWebView.m
//  NEWS
//
//  Created by lanou on 16/4/9.
//  Copyright © 2016年 孙金龙. All rights reserved.
//

#import "DetailWebView.h"
#define KWidth [UIScreen mainScreen].bounds.size.width
#define KHeight  [UIScreen mainScreen].bounds.size.height
@interface DetailWebView ()
@property (nonatomic,strong)UIView *bigView;
@end

@implementation DetailWebView

- (void)viewDidLoad {
    [super viewDidLoad];
    [self addView];
    UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 70, KWidth, KHeight)];
    webView.backgroundColor = [UIColor whiteColor];
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:_model.shareUrl]];
    [webView loadRequest:request];
    [self.view addSubview:webView];
    
    
    // Do any additional setup after loading the view.
}

- (void)addView
{
    _bigView = [[UIView alloc] initWithFrame:CGRectMake(0, 20, KWidth, 50)];
    _bigView.backgroundColor = [UIColor whiteColor];
    UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
    button.frame = CGRectMake(0, 0, 50, 50);
    [button setTitle:@"返回" forState:UIControlStateNormal];
    [button addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];
    [_bigView addSubview:button];
    [self.view addSubview:_bigView];
}

- (void)buttonAction:(UIButton *)button
{
    [self.nav popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
